package top.ed333.mcplugins.configurableevents.action;

import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
import top.ed333.mcplugins.configurableevents.DependenciesResolver;
import top.ed333.mcplugins.configurableevents.PlayerPointsHelper;

public class PointsTakeAction extends Action {
    public PointsTakeAction(int value) {
        super(value);
    }

    @Override
    public String name() {
        return "point-take";
    }

    @Override
    public void execute(@Nullable Player player) {
        if (player != null && DependenciesResolver.isPlayerPointsInstalled()) {
            PlayerPointsHelper.takePoints(player, (int) value());
        }
    }
}
